﻿using Furion.Schedule;

namespace RedPacket.Utils
{
    /// <summary>
    /// 定时任务注入
    /// </summary>
    public static class CustomJobs
    {
        /// <summary>
        /// 定时任务注入
        /// </summary>
        /// <param name="services"></param>
        public static void AddCustomJobs(this IServiceCollection services)
        {

            services.AddSchedule(opt =>
            {
                opt.AddJob<Jobs.TeamJoinRobot>("TeamJoinRobot", Triggers.PeriodSeconds(10));

                opt.AddJob<Jobs.EndTeamBuy>("EndTeamBuy", Triggers.PeriodMinutes(5));
            });

        }
    }
}
